#!/bin/bash

str=$1
pos=`expr index $str '.'`
len=`expr length $str`
echo $pos
len=$((len - pos + 1))

file_type=`expr substr $str $pos $len`
((pos--))
file_name=`expr substr $str 1 $pos`

echo "file_name = $file_name"
echo "file_type = $file_type"

